package server;

/**
 *@author Adam
 */

import java.rmi.RMISecurityManager;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Vector;
import display.RMIServer;

public class RMIDisplayClient {
	String name;
	RMIServer server;
	Registry registry;

	public RMIDisplayClient(String myName){
		name = myName;
	}

	public void begin(String location) {
		System.setSecurityManager(new RMISecurityManager());
		try {
			registry = LocateRegistry.getRegistry(location);
			server = (RMIServer)registry.lookup(name);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void displayInfo(String s){
		try{
			server.displayInfo("tra la la la la");
			} catch (Exception e){
				e.printStackTrace();
			}
	}
}
